package com.longteng.lesson.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator
 * DATE : 2018/6/3
 * TIME : 13:36
 * PROJECT : java-lesson
 * PACKAGE : com.longteng.lesson
 *
 * @author <a href="mailto:taki@qq.com">Administrator</a>
 */
@Controller
@RequestMapping("/cssController")
public class CssController {
    @RequestMapping("/cssPage")
    public String cssPage(){
        return "/css/cssPage";
    }

    @RequestMapping("/bootstrapTable")
    public String bootstrapTable(){
        return "/css/bootstrapTable";
    }
    @RequestMapping("/table")
    public String table(){
        return "/css/table";
    }

    @RequestMapping("/getData")
    public @ResponseBody
    Map getData(int offset,int limit,String abc){
        List datas=new ArrayList();
        for(int i=1;i<=50;i++){
            Map map=new HashMap();
            map.put("name","第一个名字"+i);
            map.put("name2","第二个名字"+i);
            datas.add(map);
        }
       List dataList=datas.subList(offset,offset+limit);
        Map returnMap=new HashMap();
        returnMap.put("total",datas.size());
        returnMap.put("rows",dataList);
        return returnMap;
//        return datas;
    }
}
